﻿Namespace("sketch.framework");

(function () {

    var fwk = sketch.framework;
    fwk.Layer = klass(fwk.Container, {
        _constructor:function() {
            this.context = null;
        },
        setContext:function(context) {
            this.context = context;
        },
        canAccept:function(element) {
            return true;
        },
        drawSelf:function() {
            if (this.invalidateRequired) {
                fwk.Layer.Super.drawSelf.call(this, this.context);
            }

            this.invalidateRequired = false;
        },
        invalidate:function() {
            this.invalidateRequired = true;
        },
        isInvalidateRequired:function() {
            return this.invalidateRequired;
        },
        contentsToString : function() {
            var s = "";
            this.children.each(function(i, child) {
                s += child.__type__ + " ;";
            });
            return s;
        },
        getSnapPoints:function(){
            return null;
        }
    });

})();